package com.wwwzh.himalayafm.adapter.recommend;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wen10 on 2016/12/7.
 */

public class AlbumDetailPagerAdapter extends PagerAdapter {
    private List<View> views;

    private List<String> strings;
    public AlbumDetailPagerAdapter(List<View> views) {

        this.views = views;
        strings = new ArrayList<>();
        strings.add("详情");
        strings.add("节目");
    }

    @Override
    public int getCount() {

        return views.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {

        return view == object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(views.get(position));
        return views.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(views.get(position));
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return strings.get(position);
    }
}
